package com.hh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hh.entity.domain.Message;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author hanhui
* @description 针对表【notification(通知表)】的数据库操作Mapper
* @createDate 2025-07-26 10:35:55
* @Entity generator.domain.Message
*/
public interface MessageMapper extends BaseMapper<Message> {
    // 根据用户ID查询消息，按创建时间倒序
    List<Message> selectByUserIdOrderByCreateTimeDesc(@Param("userId") String userId);

    // 统计未读消息数量
    long countUnreadByUserId(@Param("userId") String userId);

}




